import os
from pyltp import Segmentor

LTP_DATA_DIR = "/home/mm/Downloads/ltp_data_v3.4.0/"
cws_model_path = os.path.join(LTP_DATA_DIR, 'cws.model')
segmentor = Segmentor()  # 初始化实例
segmentor.load(cws_model_path)  # 加载模型


def seg_word_set(strin):
    words = segmentor.segment(strin)
    set_words = set(list(words))
    return set_words
